var module_name = "HORNET CHAT";
var textBox = document.getElementById("chat_text_box");
var chatLog = document.getElementById("chat_log");

function createChatWindow(){

    var myDiv = document.getElementById("my_dialog");

    // dialog-extend options
    var dialogExtendOptions = {
        "closable" : true,
        "maximizable" : true,
        "minimizable" : true,
        "title" : "Hornet Chat",
        //"minimizeLocation" : $("#my-form [name=minimizeLocation]:checked").val() || false,
        "collapsable" : true
        //"dblclick" : $("#my-form [name=dblclick]:checked").val() || false,
        //"titlebar" : $("#my-form [name=titlebar]:checked").val() || false
    };




    myDiv.style.visibility = "visible";
    $('#my_dialog').dialog({
            height: 500
        }
    //).dialogExtend(dialogExtendOptions);
    );

}

function processChatMessage(){

    var key = window.event.keyCode;

    if (key == 13){
        var textBox = document.getElementById("chat_text_box");
        var chatLog = document.getElementById("chat_log");

        var chatMessage = textBox.value;
        var tmpHtml = chatLog.innerHTML;
        chatLog.innerHTML = tmpHtml + chatMessage + "<br />";

        textBox.value = '';
        chatLog.scrollTop = chatLog.scrollHeight;
    }

}